-module(web_session).
-behaviour(gen_server).
-define(SERVER,?MODULE).
-export([start/0,start_link/0,init/1,handle_call/3,handle_cast/2,handle_info/2,terminate/2,code_change/3]).
start()  ->
	gen_server:start({local, ?SERVER}, ?MODULE, [], []).
start_link() ->
	gen_server:start_link(?MODULE, [], []).
init([]) ->
	{ok,{running,{}}}.
handle_call(ping,_,State) ->
	{reply, pong, State};
handle_call({html_call,{Module,Method,""}},_,State) ->
	{reply,apply(list_to_atom(Module),list_to_atom(Method),[]),State};
handle_call({html_call,{Module,Method,Param}},_,State) ->
	{reply,apply(list_to_atom(Module),list_to_atom(Method),Param),State};
handle_call(_,_,State) ->
	{reply, {error,"no func define sctp server"}, State}.
handle_cast(Request, State) ->
	{noreply,State}.
handle_info(_, State) ->
	{noreply,State}.
terminate(_, _) ->
	ok.
code_change(_, State, _) ->
	{ok,State}.
